﻿@model OpenMVCRM.ViewModels.ClientViewModel

@{
    ViewBag.Title = Model.Name;
}
<fieldset>
<div class="divContainer">
<div class="divEditBar">
<div class="divBreadCrump">
      <span>You are here : </span>
      @Html.ActionLink("Clients","Index") <span class="breadCrumpSeperator"></span>
      <span> @Html.ActionLink(@Model.Name, "Index", new { @id=Model.ID}) </span><span class="breadCrumpSeperator"></span>
      Addresses
      
</div>
<div class="divEditRightLinks"> 
       @Html.ActionLink("Edit","Edit",new {@id=Model.ID})
       @Html.ActionLink("Delete", "Delete", new { @id = Model.ID })
</div>
</div>

    @if (!String.IsNullOrEmpty(Model.Message))
    {
        <div class="actionSuccess">
            <p>@Model.Message</p>
        </div>
    }

<div class="divClientInfo">

<h2>@Model.Name</h2>


</div>
<div class="divAddressInfo">
 <h3>Address Information</h3>
 <div class="divRightLinks">
    @Html.ActionLink("Add New", "AddAddress", new { @id = Model.ID })
 </div>
 @foreach (var address in Model.Addresses)
 {
     <div class="divAddressTile">
     <div class="divTileEditBar">
         @Html.ActionLink("Edit", "EditAddress", new { @id = address.ID, @clientId = Model.ID }) |
        @Html.ActionLink("Delete", "DeleteAddress", new { @id = Model.ID })
     </div>
       <p>@address.AddressLine1</p>
       <p>@address.AddressLine2</p>
       <p>@address.City</p>
       <p>@address.StateName -@address.CountryName - @address.ZipCode</p>
     </div>
 } 
</div>
</div>
</fieldset>